package listeners
{
	import events.*;
	import mx.controls.Alert;
	
	public class event_listeners
	{
		private var obj_class:Object = new Object();
		
		public function event_listeners(obj:Object, func_callback:Function){
			this.obj_class = obj;
			this.set_listeners(obj, func_callback);
		}
		
		private function set_listeners(obj:Object, func_callback:Function): void {
			//main menu
			obj.addEventListener(event_handler.NEWS, event_listener(event_handler.NEWS, func_callback));
			obj.addEventListener(event_handler.PROJECTS, event_listener(event_handler.PROJECTS, func_callback));
			obj.addEventListener(event_handler.RESEARCH, event_listener(event_handler.RESEARCH, func_callback));
			obj.addEventListener(event_handler.PROFILE, event_listener(event_handler.PROFILE, func_callback));
			obj.addEventListener(event_handler.IDEAS, event_listener(event_handler.IDEAS, func_callback));
			obj.addEventListener(event_handler.CONSULTANCY, event_listener(event_handler.CONSULTANCY, func_callback));
			obj.addEventListener(event_handler.CONTACTUS, event_listener(event_handler.CONTACTUS, func_callback));
		
			//submenu projects
			obj.addEventListener(event_handler.PLANTATIONBAY, event_listener(event_handler.PLANTATIONBAY, func_callback));
			obj.addEventListener(event_handler.INARAHAN, event_listener(event_handler.INARAHAN, func_callback));
			obj.addEventListener(event_handler.PANAMCLIPPER, event_listener(event_handler.PANAMCLIPPER, func_callback));
			obj.addEventListener(event_handler.ALMACEN, event_listener(event_handler.ALMACEN, func_callback));
			obj.addEventListener(event_handler.AZOTEA, event_listener(event_handler.AZOTEA, func_callback));
			obj.addEventListener(event_handler.CHOCOLATEHOUSE, event_listener(event_handler.CHOCOLATEHOUSE, func_callback));
			obj.addEventListener(event_handler.FOUNTAIN, event_listener(event_handler.FOUNTAIN, func_callback));
			obj.addEventListener(event_handler.GARDENHOUSE, event_listener(event_handler.GARDENHOUSE, func_callback));
			obj.addEventListener(event_handler.KIOSK, event_listener(event_handler.KIOSK, func_callback));
			obj.addEventListener(event_handler.SIESTASHED, event_listener(event_handler.SIESTASHED, func_callback));
			obj.addEventListener(event_handler.STORAGESHED, event_listener(event_handler.STORAGESHED, func_callback));
			
			
			
			//submenu consultancy
			obj.addEventListener(event_handler.ARCHITECTURE, event_listener(event_handler.ARCHITECTURE, func_callback));
			obj.addEventListener(event_handler.ENVIRONMENTPLANNING, event_listener(event_handler.ENVIRONMENTPLANNING, func_callback));
			obj.addEventListener(event_handler.INTERIORDESIGN, event_listener(event_handler.INTERIORDESIGN, func_callback));
			obj.addEventListener(event_handler.CONSERVATION, event_listener(event_handler.CONSERVATION, func_callback));
			obj.addEventListener(event_handler.CITYMUNICIPAL, event_listener(event_handler.CITYMUNICIPAL, func_callback));
			
		}
		
		private function event_listener(flag:String, func_callback:Function): Function {
			return function(evt:event_handler): void{
				func_callback(flag, evt.data);
			}
		}

	}
}